package cn.pzhuweb.dao.imp;

import cn.pzhuweb.dao.CarDAO;
import cn.pzhuweb.pojo.Car;
import cn.pzhuweb.util.DruidUtil;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;

import java.util.List;

/**
 * @author Yancy xiao
 * @create 2022-11-15 10:31
 */
public class CarDAOImp implements CarDAO {
    private JdbcTemplate template = new JdbcTemplate(DruidUtil.getDs());

    @Override
    public List<Car> selectByKeyWords(String password) {
        return null;
    }

    @Override
    public int insert(Car car) {
        return 0;
    }

    @Override
    public int delete(Integer integer) {
        return 0;
    }

    @Override
    public int update(Car car) {
        return 0;
    }

    @Override
    public Car selectById(Integer integer) {
        return null;
    }

    @Override
    public List<Car> selectAll() {
        String sql = "select * from car";
        return template.query(sql, new BeanPropertyRowMapper<Car>(Car.class));
    }
}
